<template>
	<div id="all_comment">
		<ul>
			<li v-for="a in active1">
				<!-- 				<div v-if=" a.active_name==active.name "> -->
				<div class="comment_list">
					<div class="message">
						<img :src="'https://yo.docshare.org.cn'+a.photo">
						<label class="name">{{a.user_name}}</label>
						<span class="date">{{a.time}}</span>
						<div class="clear"></div>
					</div>
					<p>
						{{a.comment}}
					</p>
				</div>
				<!-- </div> -->
			</li>
		</ul>
	</div>
</template>

<script>
	import config from '@/config'
	export default {
		data() {
			return {
				usr: '',
				active1: [],
				active: {},
				vid: ''
			}
		},
		onLoad(option) {
			if (option.id) {
				this.vid = option.id;
			}

			var that = this;
			uni.request({
				url: `${config.baseUrl}/comment/list?token=` + uni.getStorageSync('token') + '&id=' + that.vid,
				method: 'GET',
				success(r) {
					if (r.data.succ) {
						that.active1 = r.data.data;
					} else {

					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});
			uni.request({
				url: `${config.baseUrl}/active/one?token=` + uni.getStorageSync('token') + '&id=' + that.vid,
				method: 'GET',
				success(r) {
					if (r.data.succ) {
						that.active = r.data.data;
					} else {

					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});

		},
		methods: {
			itemClicked: function(item) {
				uni.navigateTo({
					url: 'activity_detail?id=' + item.id
				})
			}
		}
	}
</script>

<style>
</style>
